{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "import numpy as np\n",
    "\n",
    "from pylab import rcParams\n",
    "from sklearn.metrics import accuracy_score, confusion_matrix, precision_score, recall_score, balanced_accuracy_score, f1_score\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "from matplotlib.colors import ListedColormap\n",
    "\n",
    "rcParams['figure.figsize'] = 8, 8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "preds = np.loadtxt('../experiments/EcgResNet34/results/predictions.txt').astype(int)\n",
    "mapping = json.load(open('../data/class-mapper.json'))\n",
    "gt = [mapping[i['label']] for i in json.load(open('../data/val.json'))]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9938449701865744"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "accuracy_score(gt, preds)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9938449701865744"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "recall_score(gt, preds, average='micro')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9938449701865744"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "precision_score(gt, preds, average='micro')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9715227374777318"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "balanced_accuracy_score(gt, preds)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9715227374777318"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(recall_score(gt, preds, average=None))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9715227374777318"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "recall_score(gt, preds, average='macro')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9787018706519426"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1_score(gt, preds, average='macro')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeEAAAHVCAYAAADGoUO1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Hl4VPXZxvH7RxKEAAHBLGqi7FVBXEAURdlEQNkCqOD2WhUEdy0VKBVxBUWtbVUkCFq1CLigUiW4sEVQKaAV6o4KhZpFEUFCIJn83j/AFBDCdiZP5vj9XFcumTNz5tyPZ2ZuzpkTnPdeAACg4lWxDgAAwK8VJQwAgBFKGAAAI5QwAABGKGEAAIxQwgAAGKGEAQAwQgkDAGCEEgYAwEh8tDfgOqeH+p/k2pz9uXUEAEAlUy0u0e3L4zgSBgDACCUMAIARShgAACOUMAAARihhAACMUMIAABihhAEAMEIJAwBghBIGAMAIJQwAgBFKGAAAI5QwAABGKGEAAIxQwgAAG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JAwBghBIGAMAIJQwAgBFKGAAAI5QwAABGKGEAAIxQwgAAGKGEAQAwQgkDAGCEEgYAwAglDACAEUoYAAAjoSnhUSNHq33bjurTs591lKhYmLNQPc/tre5demrSxMnWcQKV+22urrx8oDK791Fmj776+zNTrCMFLsz7T2K+WBSJRHRhnwG6fsgNOy2/75771ablGUapglfZ911oSrhXZg+Nz3rUOkZURCIR3Xv3WD024RHNmPmisl/P1sovV1rHCkxcfJyG3nqLZvzjJT079WlNnTItVPOFff8xX2ya8sxzatCowU7L/r3iY23YsMEoUfBiYd+FpoRbtmqppNq1rWNExYrlK5RxVIbSM9KVUDVBXbt10bw586xjBSY5OVnHHnesJKlGjRpq2LCB8vMLjFMFJ+z7j/liT15unnLm56hP395lyyKRiP70wMO6aeiNhsmCFQv7LjQlHGb5eflKS0stu52Slqq8EJXUjtau/a8+/eQzHd+iuXWUwIR9/zFf7Bk39gHdNPRGuSr/q4CpU6apXYezlJycbJgsWLGw7/Zaws65W3b92eG+S/awziDn3BLn3JLKeA4elVPhpkL97sah+v2IoapZs6Z1HCCUFsxboEPr1tVxzY4rW5afX6A3Z7+lARf3N0z26xS/D4+pVc59NXa30HufJSlLkooihf4AcmEHKakpys3NK7udn5un1JTw/G1VkoqLi3XLTUN1bvduOrtzJ+s4gQr7/mO+2PLhsn9p/tz5emfBO9q6Zas2bdqkvj37qWpCVfXo2kuSVFRUpB5demrm7FeN0x6cWNh3ez0S9t7fsevPDvdNiG48SFKz5s20etVqrVmzVsVbi5U9a7badWhvHSsw3nuNvu0ONWzYQJddfql1nMCFff8xX2y54Zbr9cbcbM166zWNfXCMTjm1lXLem6+3c97UrLde06y3XlO1atVivoCl2Nh3+3IkHBOGDR2uJYuXav369ercoYuGXDdYffpmWscKRHx8vEaMHKYhA69RaWmpemf2UuMmjaxjBeaDZR/qH6++piZNm+iCzAslSdffdJ3ObHemcbJghH3/MR8qq1jYd8776J4t5nQ0AOw/r/B+dDo56whRVy0ucZ+G5OpoAACMUMIAABih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ScoxCXsvf9EUtPt352Gkvf+A0kfKTynbAdImrHLshcVnvkkSc65wc65y6xzRMmu3wlXqqujQ3E6GogVzrnHte3IaqF1FgD2KGEAAIyE8XQ0AAAxgRIGAMAIJQwAgBFKGAAAI5QwAABGKGEAAIz8Px9EftLXOWaAAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 576x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "ax = sns.heatmap(confusion_matrix(gt, preds), annot=True, cmap=\"Greens\", fmt='g', \n",
    "                 xticklabels=mapping.keys(), yticklabels=mapping.keys(), cbar=False, square=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "N - 0.998262, L - 0.996283, V - 0.983146, \\ - 1.000000, R - 0.997245, A - 0.882353, ! - 0.914894, E - 1.000000, "
     ]
    }
   ],
   "source": [
    "for value, label in zip(recall_score(gt, preds, average=None), mapping.keys()):\n",
    "    print (\"{} - {:4f}\".format(label, value), end=', ')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
